package com.example.firstprojectnew.exception;

import com.example.firstprojectnew.common.WrapMapper;
import com.example.firstprojectnew.common.Wrapper;
import org.springframework.core.annotation.Order;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: lihua
 * @Date: 2025/3/14 14:27
 * @Version: v1.0.0
 * @Description:
 **/
@ControllerAdvice
@RestController
@Order(1)
public class MyExceptionNewController {

    @ExceptionHandler(value = NullPointerException.class)
    public Wrapper nullException(){
        return WrapMapper.error("空指针异常2");
    }
}
